﻿@page "{id:int}"
@model ModifyModel
@using Ninesky.Models;
@section Aside
    {
    @await Html.PartialAsync("_Aside")
}

<ol class="breadcrumb">
    <li><span class="glyphicon glyphicon-home"></span>  <a asp-page="/Manage/Index">首页</a></li>
    <li><a asp-page="/Manage/Category/Index">栏目管理</a></li>
    <li class="active">编辑栏目</li>
</ol>

@if (Model.Notice == null)
{

    <div class="panel panel-default">
        <div class="panel-body">
            <form method="post" class="form-horizontal">
                <div asp-validation-summary="ModelOnly" class="text-danger"></div>
                <input type="hidden" asp-for="Input.CategoryId">
                <div class="form-group" data-ns-group="all">
                    <label asp-for="Input.Type" class="control-label col-md-2 col-sm-2"></label>
                    <div class="col-md-10 col-sm-10">
                        <select asp-for="Input.Type" asp-items="Html.GetEnumSelectList<CategoryType>()" class="form-control" disabled></select>
                        <input type="hidden" asp-for="Input.Type" />
                        <span asp-validation-for="Input.Type" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label asp-for="Input.ParentId" class="control-label col-md-2 col-sm-2"></label>
                    <div class="col-md-10 col-sm-10">
                        <div class="input-group">
                            <input type="text" asp-for="Input.ParentId" class="form-control" readonly>
                            <div class="input-group-btn">
                                <button type="button" id="Input_ParentId_Text" class="btn btn-default" style="margin-left:auto;margin-right:auto">无</button>
                                <button type="button" id="Input_ParentId_Btn" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">选择 <span class="caret"></span></button>
                                <div id="Input_ParentId_Dropdown" class="dropdown-menu dropdown-menu-right">
                                    <div>
                                        <ul id="Input_ParentId_Tree" class="ztree" data-ns-url="/Manage/Category/GetParentCategoryList"></ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <span asp-validation-for="Input.ParentId" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label asp-for="Input.Name" class="control-label col-md-2 col-sm-2"></label>
                    <div class="col-md-10 col-sm-10">
                        <input asp-for="Input.Name" class="form-control" />
                        <span asp-validation-for="Input.Name" class="text-danger"></span>
                    </div>

                </div>
                <div class="form-group">
                    <label asp-for="Input.PicUrl" class="control-label col-md-2 col-sm-2"></label>

                    <div class="col-md-10 col-sm-10">
                        <input asp-for="Input.PicUrl" class="form-control" />
                        <span asp-validation-for="Input.PicUrl" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label asp-for="Input.Meta_Keywords" class="control-label col-md-2 col-sm-2"></label>
                    <div class="col-md-10 col-sm-10">
                        <textarea asp-for="Input.Meta_Keywords" class="form-control"></textarea>
                        <span asp-validation-for="Input.Meta_Keywords" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label asp-for="Input.Meta_Description" class="control-label col-md-2 col-sm-2"></label>
                    <div class="col-md-10 col-sm-10">
                        <textarea asp-for="Input.Meta_Description" class="form-control"></textarea>
                        <span asp-validation-for="Input.Meta_Description" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label asp-for="Input.Description" class="control-label col-md-2 col-sm-2"></label>
                    <div class="col-md-10 col-sm-10">
                        <textarea asp-for="Input.Description" class="form-control"></textarea>
                        <span asp-validation-for="Input.Description" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group" data-ns-group="all">
                    <label asp-for="Input.Target" class="control-label col-md-2 col-sm-2"></label>
                    <div class="col-md-10 col-sm-10">
                        <select asp-for="Input.Target" asp-items="Html.GetEnumSelectList<LinkTarget>()" class="form-control"></select>
                        <span asp-validation-for="Input.Target" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label asp-for="Input.Order" class="control-label col-md-2 col-sm-2"></label>
                    <div class="col-md-10 col-sm-10">
                        <input asp-for="Input.Order" class="form-control" />
                        <span asp-validation-for="Input.Order" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label asp-for="Input.View" class="control-label col-md-2 col-sm-2"></label>
                    <div class="col-md-10 col-sm-10">
                        <input asp-for="Input.View" class="form-control" />
                        <span asp-validation-for="Input.View" class="text-danger"></span>
                    </div>
                </div>
                <div id="general_inputbox">
                    <div class="form-group" data-ns-group="all">
                        <label asp-for="Input.ModuleType" class="control-label col-md-2 col-sm-2"></label>
                        <div class="col-md-10 col-sm-10">
                            <select asp-for="Input.ModuleType" asp-items="Html.GetEnumSelectList<ModuleType>()" class="form-control"></select>
                            <span asp-validation-for="Input.Target" class="text-danger"></span>
                        </div>
                    </div>
                    <div id="content_inputbox">
                        <div class="form-group">
                            <label asp-for="Input.ContentView" class="control-label col-md-2 col-sm-2"></label>
                            <div class="col-md-10 col-sm-10">
                                <input asp-for="Input.ContentView" class="form-control" />
                                <span asp-validation-for="Input.ContentView" class="text-danger"></span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label asp-for="Input.ContentOrder" class="control-label col-md-2 col-sm-2"></label>
                            <div class="col-md-10 col-sm-10">
                                <select asp-for="Input.ContentOrder" asp-items="Html.GetEnumSelectList<ContentOrder>()" class="form-control"></select>
                                <span asp-validation-for="Input.ContentOrder" class="text-danger"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label asp-for="Input.PageSize" class="control-label col-md-2 col-sm-2"></label>
                            <div class="col-md-10 col-sm-10">
                                <input asp-for="Input.PageSize" class="form-control" />
                                <span asp-validation-for="Input.PageSize" class="text-danger"></span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label asp-for="Input.ShowOnMenu" class="control-label col-md-2 col-sm-2"></label>
                    <div class="col-md-10 col-sm-10">
                        <input asp-for="Input.ShowOnMenu" />
                        <span asp-validation-for="Input.ShowOnMenu" class="text-danger"></span>
                    </div>
                </div>
                <div id="link_inputbox">
                    <div class="form-group">
                        <label asp-for="Input.LinkUrl" class="control-label col-md-2 col-sm-2"></label>
                        <div class="col-md-10 col-sm-10">
                            <input asp-for="Input.LinkUrl" class="form-control" />
                            <span asp-validation-for="Input.LinkUrl" class="text-danger"></span>
                        </div>
                    </div>
                </div>
                <button type="submit" class="btn btn-primary col-md-offset-2 col-sm-offset-2">保存</button>
                <button type="button" id="btn_delete" asp-page-handler="Delete" asp-route-id="@Model.Input.CategoryId" data-ns-retrun-url="/Manage/Category/Index" class="btn btn-danger">删除</button>
            </form>
        </div>
    </div>

    @section scripts{
        @await Html.PartialAsync("_ValidationScriptsPartial")
        <script src="~/lib/zTree/js/jquery.ztree.core.min.js"></script>
        <script src="~/lib/bootstrap3-dialog/dist/js/bootstrap-dialog.min.js"></script>
        <script src="~/Manage/Default/Js/Category.js"></script>
        <script src="~/Manage/Default/Js/CategoryModify.js"></script>
        <script src="~/Manage/Default/Js/CategoryAside.js"></script>
    }
}
else
{
    Html.RenderPartial("_Notice", Model.Notice);
    @section scripts{
        @await Html.PartialAsync("_ValidationScriptsPartial")
        <script src="~/lib/zTree/js/jquery.ztree.core.min.js"></script>
        <script src="~/Manage/Default/Js/CategoryAside.js"></script>
    }
}
@section css{
    <link href="~/lib/zTree/css/metroStyle/metroStyle.css" rel="stylesheet" />
    <link href="~/lib/bootstrap3-dialog/dist/css/bootstrap-dialog.min.css" rel="stylesheet" />
}